Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow empty string as argument for --output-dir-flat and --output-dir-mirror #3220

Merged
merged 2 commits into from
Aug 1, 2022

Conversation

embg
Copy link
Contributor

@embg embg commented Jul 29, 2022

Edit: commit e1873ad fixes the buffer underflow, but I realized there is a deeper issue here. The current behavior for --output-dir-flat="" and --output-dir-mirror="" maps "" -> "/". This is bad. Therefore, in f9f27de, I disallow empty string as an argument for those flags (and add a test verifying that behavior).

@embg embg changed the title Fix buffer underflow for null dir1 Fix buffer underflow for dir1 == "" Jul 29, 2022
@terrelln
Copy link
Contributor

Please add a test case to the cli-tests https://github.com/facebook/zstd/tree/dev/tests/cli-tests/basic

@terrelln
Copy link
Contributor

LGTM once you have a test case

@embg embg changed the title Fix buffer underflow for dir1 == "" Disallow empty string as argument for --output-dir-flat and --output-dir-mirror Jul 30, 2022
@embg
Copy link
Contributor Author

embg commented Jul 30, 2022

LGTM once you have a test case

Added a test and disallowed empty string as an argument for --output-dir-flat and --output-dir-mirror.

@embg embg merged commit 28ceb63 into facebook:dev Aug 1, 2022
@embg embg deleted the issue3200 branch August 1, 2022 18:05
@Cyan4973 Cyan4973 mentioned this pull request Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buffer overrun can happen in util.c
3 participants